package com.lvkerry.generate;


import com.lvkerry.generate.bean.MenuBean;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Random;
import java.util.Set;

/**
 * @author Kerry on 18/03/07
 */

public class MenuGenete {


    private static String[] MENUS = {"红烧肉", "糖醋排骨", "红烧排骨", "可乐鸡翅", "鱼香肉丝", "茶叶蛋", "水煮鱼", "口水鸡", "回锅肉",
            "红烧猪蹄", "皮蛋瘦肉粥", "酸菜鱼", "咖喱牛肉", "西红柿炒鸡蛋", "葡萄酒",
            "红烧鱼", "龙井虾仁", "蛋炒饭", "水煮肉片", "奶茶", "佛跳墙", "鲫鱼豆腐汤",
            "酸辣土豆丝", "乌鸡汤", "煎蛋", "辣椒酱", "意大利面", "麻辣烫"};

    public static Set<MenuBean> addMenuData(int minMoney, int moneyOffset) {

        Random random = new Random();

        Set<MenuBean> set = new LinkedHashSet<>();

        for (int i = 0; i < MENUS.length; i++) {

            int money = random.nextInt(moneyOffset) + minMoney;
            MenuBean mb = new MenuBean();
            mb.setAddTime(System.currentTimeMillis());
            mb.setAvatarUrl("http://taobao.gson8.com/1862067548.jpeg");
            mb.setDesp("详情......" + MENUS[i]);
            mb.setName(MENUS[i]);
            mb.setIsDeleted(0);
            mb.setPrice(new BigDecimal(money));
            if (i % 7 == 0) {
                mb.setRemark("洋葱汁,蕃茄汁,黑椒汁");
            }
            set.add(mb);
        }
        return set;
    }
}
